package com.ezhou.hy.admin.serviceImpl;

import java.io.IOException;

import com.ezhou.hy.admin.dao.AdminDao;
import com.ezhou.hy.admin.domain.Admin;
import com.ezhou.hy.admin.service.AdminService;
import com.ezhou.hy.common.dao.DaoFactoryManager;
import com.ezhou.hy.exception.DaoException;


/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>CopyRight:Copyright (c) 2008.12 </p>
 * <p>Company: </p>
 * @author Haiger
 * @version 1.0
 */
public class AdminServiceImpl implements AdminService{
//	private AdminDao adminDao = new AdminDaoImpl();
//	private Admin       admin = new Admin();
	
	private AdminDao adminDao;
	
	
	public void addAdmin(Admin admin) throws DaoException, IOException, IllegalAccessException, InstantiationException{

		adminDao = (AdminDao)DaoFactoryManager.buildDaoFactory().getDao(AdminDao.class);

		adminDao.save(admin);
	}

	
/** JUST FOR TEST **/	
//	public static void main(String[] args){
//		AdminServiceImpl as = new AdminServiceImpl();
//		try {
//			as.addAdmin(new Admin());
//		} catch (DaoException e) {
//			System.out.println("dao");
//			e.printStackTrace();
//		} catch (IOException e) {
//			System.out.println("IO");
//			e.printStackTrace();
//		} catch (IllegalAccessException e) {
//			System.out.println("access");
//			e.printStackTrace();
//		} catch (InstantiationException e) {
//			System.out.println("Instant");
//			e.printStackTrace();
//		}
//	}

}
